CREATE TABLE [dbo].[TRDOPR_FOTO]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NOT NULL,
[NU_DOCU_PROV] [dbo].[TD_VC_020] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TRDOPR_FO__NU_SE__59662CFA] DEFAULT ((0)),
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[DE_DETA_FOTO] [dbo].[TD_VC_100] NULL,
[OB_FOTO] [image] NULL,
[ST_VISU] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TRDOPR_FO__ST_VI__5A5A5133] DEFAULT ('N'),
[RU_FOTO] [dbo].[TD_VC_200] NULL,
[DE_OBSE_0001] [dbo].[TD_VC_200] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TRDOPR_FO__CO_US__5C4299A5] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TRDOPR_FO__FE_US__5D36BDDE] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TRDOPR_FO__CO_US__5E2AE217] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TRDOPR_FO__FE_US__5F1F0650] DEFAULT (getdate())
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[TRDOPR_FOTO] WITH NOCHECK ADD CONSTRAINT [CK__TRDOPR_FO__ST_VI__5B4E756C] CHECK NOT FOR REPLICATION (([ST_VISU]='N' OR [ST_VISU]='S'))
GO
ALTER TABLE [dbo].[TRDOPR_FOTO] ADD CONSTRAINT [PK__TRDOPR_F__1F2F045C0BC78F95] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_PROV], [CO_TIPO_DOCU], [NU_DOCU_PROV], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TRDOPR_FOTO] ADD CONSTRAINT [FK__TRDOPR_FO__CO_EM__1E063B61] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
